<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.chanyachting.emall.service.ShortmessageService" %>
<%@ page import="com.chanyachting.emall.serviceImpl.ShortmessageServiceImpl" %>

<%@ page import="com.chanyachting.emall.domain.Member" %>
<%@ page import="com.chanyachting.emall.domain.Shortmessage" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.MemberService" %>
<%@ page import="java.util.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title></title>
</head>

<body>
<%@ include file="memberInfoMenu.jsp" %>
<form id="form1" name="form1" method="post" action="">
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="yes_border">
    <tr>
      <th width="15%" height="28" align="center">选择</th>
      <th align="center">标题</th>
      <th width="10%" align="center">状态</th>
      <th width="10%" align="center">发件人</th>
      <th width="15%" align="center">发送时间</th>
    </tr>
    
    <%
    
    	//获得指定会员所有站内短消息
    	ShortmessageService smservice=new ShortmessageServiceImpl();
    
	   //从session 中获得会员对象
	
		RequestUtil ru=new RequestUtil(request);
		
		Member member=(Member)ru.getSessionObject(MemberService.MEMBER_IN_SESSION,new Member());
		
		List msgList=smservice.getAllShortmessageByAccess(member);
    
    %>
    
    <%
    	if(msgList!=null && msgList.size()>0){
    		
    		Shortmessage smsg=null;
    		
    		for(int i=0;i<msgList.size();i++){
    			
    			smsg=(Shortmessage)msgList.get(i);
    %>
    
     <tr>
      <td height="28" align="center"><label>
        <input type="checkbox" name="checkbox" id="checkbox" />
      </label></td>
      <td>　<a href="#"><%= smsg.getTitle() %></a></td>
      <td align="center"><%= smsg.getStatus().equals("00")?"未读":"已读" %></td>
      <td align="center"><%= smsg.getSender() %></td>
      <td align="center"><%= smsg.getSendDate() %></td>
    </tr>
    
    <%
    			
    		}
    		
    	}
    
    %>
    

    
    <tr>
      <td height="28" align="center"><a href="#">全选</a>　 <a href="#">删除</a></td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td align="center">&nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>
